<?php 

// No direct access
defined ('_JEXEC') or die();

$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');

?>

<form action='index.php' method='post' name='adminForm' id='adminForm'>
	<input type="hidden" name="option" value="<?php echo $option; ?>" /> <input
		type="hidden" name="task" value="" /> <input type="hidden" name="view"
		value="<?php echo $view; ?>" /> <input type='hidden' name='boxchecked'
		value='0' />
	<?php 
	echo JHtml::_('form.token');
	echo JHTML::_('behavior.modal');
	?>

	<div id='editcell'>
		<table class='adminlist'>
			<thead>
				<tr>
					<th width='1%'><input type='checkbox'
						onclick='Joomla.checkAll(this)'
						title='<?php echo JText::_('Check all')?>' />
					</th>
					<th>Ngày</th>
					<th>Nội dung</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan='4'><?php echo $this->pagination->getListFooter(); ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
				<?php
				if (!empty($this->items))
				{
					$k = 0;
					$i = 0;
					foreach ($this->items as $row)
					{
						$checked = JHtml::_('grid.id', $i++, $row->id);
						$link = JRoute::_('index.php?option=' . $option . '&task=order.edit&id=' . $row->orderid);
						?>
				<tr class="row<?=$k?>">
					<td><?php echo $checked; ?></td>
					<td><?php echo $row->date; ?></td>
					<td><?php echo $row->username . $row->note;?><a
						href='<?php echo $link; ?>'><?php echo $row->orderid; ?> </a></td>
				</tr>
				<?php
				$k = 1 - $k;
					}
				}
				?>
			</tbody>
		</table>
	</div>
</form>
